import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/views/index'
import ChatDetails from '@/views/chatDetails'
import Login from '@/views/login'
import Register from '@/views/register'
import AddFirst from '@/views/add-first'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      title: '首页',
      component: Index,
      meta: {
        requireAuth: true
      },
    },
    {
      path: '/login',
      name: 'login',
      title: '登录',
      component: Login,
      meta: {
        requireAuth: false
      },
    },
    {
      path: '/register',
      name: 'register',
      title: '注册',
      component: Register,
      meta: {
        requireAuth: false
      },
    },
    {
      path: '/chat_details',
      name: 'chat_details',
      title: '聊天详情',
      component: ChatDetails,
      meta: {
        requireAuth: true
      },
    },
    {
      path: '/add-first',
      name: 'add-first',
      title: '加好友/群',
      component: AddFirst,
      meta: {
        requireAuth: true
      },
    }
  ]
})
